//  Brett Jones
//  PBR Senior Thesis
//  Copyright Brett Jones October 2007

using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Xml;
using Exocortex.Geometry3D;

namespace PBR
{
    //Todo - convert to a singleton class??
    /// <summary>
    /// Holds all the data pertaining to the light in the scene
    /// </summary>
    public class Light : IConvertToXml
    {
        #region Member Variables

        private Color mColor;
        private Vector3 mPos;

        #endregion

        #region Member Functions

        public Light(Color color, Vector3 pos)
        {
            mColor = color;
            mPos = pos;
        }

        public void ConvertToXml(XmlElement root, XmlDocument doc)
        {
            XmlElement light = doc.CreateElement(XMLSchema.Light);
            light.SetAttribute(XMLSchema.LightColor, mColor.ToString());
            light.SetAttribute(XMLSchema.LightPosition, mPos.ToString());
            root.AppendChild(light);
        }

        #endregion

        #region Properties

        public Color Color
        {
            get
            {
                return mColor;
            }
            set
            {
                mColor = value;
            }
        }

        public Vector3 Pos
        {
            get
            {
                return mPos;
            }
            set
            {
                mPos = value;
            }
        }

        #endregion
    }
}
